<extend name="Base/agent"/>
<block name="content">					
			<!--主体内容-->
			<div class="admin-main">
				<p class="current-title">资金明细</p>
				<p class="current-park"><i class="icon icon-index"></i><a href="#" class="current-index">首页</a> 〉〉 资金明细</p>
				<div class="current-condition">
					<input type="text" name="nickname" value="{:I('nickname')}" class="current-username" placeholder="客户名称"/>
					<input type="text" name="mobile" value="{:I('mobile')}"class="current-broker" placeholder="电话号码"/>
					<select class="yorn-broker" name="status" id="status">
	                    <option value="-2" <if condition="$status eq -2">selected</if>  style="width:200px">操作类型</option> 
	                    <option value="1" <if condition="$status eq 1">selected</if>  style="width:200px">充值</option>
	                    <option value="2" <if condition="$status eq 2">selected</if>  style="width:200px">提现</option>
	                    <option value="3" <if condition="$status eq 3">selected</if>  style="width:200px">下单</option>
	                    <option value="4" <if condition="$status eq 4">selected</if>  style="width:200px">平仓</option>
	                    <option value="5" <if condition="$status eq 5">selected</if>  style="width:200px">盈利</option>
	                    <option value="6" <if condition="$status eq 6">selected</if>  style="width:200px">佣金</option>
	                    <option value="7" <if condition="$status eq 7">selected</if>  style="width:200px">系统操作</option>
	                    <option value="8" <if condition="$status eq 8">selected</if>  style="width:200px">提现返回</option>
					</select><br><br>
					
					<input type="text" name="start_time" value="{:I('start_time')}" class="current-stardate" placeholder="起始时间"/>
					<span style = "margin-left:-15px">至</span>
					<input type="text" name="end_time" value="{:I('end_time')}" class="current-stardate" placeholder="结束时间"/>
					<!-- <input type="text" class="current-enddate" placeholder="结束时间"/> -->
					<input type="button" href="javascript:;" id="search" url="{:U('fund')}" value="搜索" class="current-serach"/>
					<input type="reset" id="clear" value="清空" class="current-reset"/>
				</div>
				<!--数据表格-->
				<div class="main-table-data">
					<p class="table-title clearfix" >资金明细 <a href="javascript:void(0);" class="fr current-inport" id="search_two">导出报表 ></a></p>
					<table class="current-table">
						<tr>
							<th>会员编号</th>
							<th>所属经纪人</th>
							<th>电话号码</th>
							<th>客户名称</th>
							<th>金额</th>
							<th>类型</th>
							<th>操作时间</th>
						</tr>
					<foreach name="list" item="v" key="k">
						<tr <if condition="$k%2!=0">class="table-bg"<else/>class="table-nobg"</if>>
							<td>{$v.id}</td>
							<td>{$v.agent}</td>
							<td>{$v.mobile}</td>
							<td>{$v.nickname}</td>
							<td>{$v.money}</td>
							<td>{$s_types[$v['type']]}</td>
							<td>{$v.create_time|time_format}</td>
						</tr>
					</foreach>
					</table>
					<!--分页-->
					<div class="current-page">
						{$show}
					</div>
				</div>
				
			</div>
<script type="text/javascript">
//搜索功能
    $("#search").click(function(){
        var url = $(this).attr('url');
        url = url.substr(0,url.lastIndexOf('.'));
        var query  = $('.current-condition').find('input').serialize();
        var status=$('#status').val();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');
        query+="/status/"+status;
        query = query.replace(/=/gm,"/");
        query = query.replace(/&/gm,"/");
        if( url.indexOf('?')>0 ){
        	if(query.substr(0,1) != "/"){
        		url += "/"+query;
        	}else{
        		url += query;
        	}
        }else{
            url += "/" + query;
        }
        window.location.href = url;
    });
     //导出搜索功能
        $("#search_two").click(function(){
            var url = "{:U('download')}";
            var query  = $('.current-condition').find('input').serialize();
            var status=$('#status').val();
            var direction=$('#direction').val();
            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
            query = query.replace(/^&/g,'');
            query+="&status="+status;
            query+="&direction="+direction;
            if( url.indexOf('?')>0 ){
                url += '&' + query;
            }else{
                url += '?' + query;
            }
           
             window.location.href = url;
        });
$("#clear").click(function(){
				window.location.href="{:U('AgentCustomer/fund')}&state=-2";
			})
</script>			
</block>